package com.inspectortime.domain.impl;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.inspectortime.common.PersistentEntityBase;
import com.inspectortime.domain.EmailTemplate;
import com.inspectortime.domain.InspectorCompany;
import com.inspectortime.timestamp.Timestamped;

@Entity
@Table(name = "EMAIL_TEMPLATE")
public class EmailTemplateImpl extends PersistentEntityBase implements Timestamped, EmailTemplate {
	
	private InspectorCompany company;
	private Date createdTime;
	private String subject;
	private Date lastModifiedTime;
	private String body;
	private String name;
	

	@ManyToOne(targetEntity = InspectorCompanyImpl.class, cascade = { CascadeType.ALL })
	public InspectorCompany getCompany() {
		return company;
	}
	
	public Date getCreatedTime() {
		return createdTime;
	}
	
	@Column( length = 255 )
	public String getSubject() {
		return subject;
	}
	public Date getLastModifiedTime() {
		return lastModifiedTime;
	}
	
	@Column( length = 30000 )
	public String getBody() {
		return body;
	}
	
	@Column( length = 50 )
	public String getName() {
		return name;
	}

	public void setCompany(InspectorCompany company) {
		this.company = company;
	}
	public void setCreatedTime(Date created) {
		this.createdTime = created;		
	}
	public void setSubject(String s) {
		this.subject = s;
	}
	public void setLastModifiedTime(Date modified) {
		this.lastModifiedTime = modified;
	}
	public void setBody(String s) {
		this.body = s;
	}
	public void setName(String name) {
		this.name = name;
	}
}
